class X {
  x = 1
  y = compute()
  local function compute() = x
}

res1 = new X {}

res2 = (res1) {
  x = 2
}

class X2 {
  x = 1
  nested {
    y = compute()
    local function compute() = x
  }
}

res3 = new X2 {}

res4 = (res3) {
  x = 2
}

res5 {
  x = 1
  y = compute()
  local function compute() = x
}

res6 = (res5) {
  x = 2
}

res7 {
  x = 1
  nested {
    y = compute()
    local function compute() = x
  }
}

res8 = (res7) {
  x = 2
}
